
const express = require('express');

const router = express.Router();

// 用户需要授权的路由

// 数据校验
const expressJoi = require('@escook/express-joi');

// 执行函数
const userHandler = require('../router_handler/user_handler');
const {get_info,put_info,resetPwd} = require('../schema/user_schema')

const articleHandler = require('../router_handler/article_handler');
const {user_article_schema} = require('../schema/article_schema')

const commentHandler= require('../router_handler/comment_handler');
const {get_comment_my} = require('../schema/comment_schema')

const replyHandler= require('../router_handler/reply_handler');
const like_collect_handle= require('../router_handler/like_collect_handle');
const {get} = require('../schema/like_collect_schema')

router.get('/userInfo' ,expressJoi(get_info),userHandler.getUserInfo);
router.get('/userArticle' ,expressJoi(user_article_schema),articleHandler.getUserArticlePage);
router.get('/myCollectArticlePage' ,expressJoi(get_comment_my),articleHandler.myCollectArticlePage);

router.put('/userInfo' ,expressJoi(put_info),userHandler.putUserInfo);
router.put('/resetPwd' ,expressJoi(resetPwd),userHandler.resetPwd);

router.get('/commntMy' ,expressJoi(get_comment_my),commentHandler.getCommntMy);

router.get('/replyMy' ,expressJoi(get_comment_my),replyHandler.getReplyMy);

router.get('/likeCollect' ,expressJoi(get),like_collect_handle.get);
router.get('/like' ,expressJoi(get),like_collect_handle.like);
router.get('/collect' ,expressJoi(get),like_collect_handle.collect);




// 导出路由
module.exports = router;
